import jsonp from 'jsonp'
export function getNewsList(key,fn){
	let url = 'https://m.toutiao.com/list/?tag=' + key + '&ac=wap&count=40&format=json_raw&as=A125A8CEDCF8987&cp=58EC18F948F79E1&min_behot_time=' + parseInt((new Date().getTime()) / 1000)+'&callback=__jp0'
	jsonp(url,null,function(err,res){
		if(err){
			console.log(err)
		}else{
			fn(res)
		}
	})
}
export function getNewsDetail(id,fn){
	let url = 'https://m.toutiao.com/' +id+ '/info/'
	jsonp(url,null,function(err,res){
		if(err){
			console.log(err)
		}else{
			fn(res)
		}
	})
}